package com.gymmsystem.GYMMSystem.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@TableName("member_card_records")
public class MemberCardRecord {

    @TableId(value = "record_id", type = IdType.AUTO)
    private Long recordId;

    @TableField("user_id")
    private Long userId;

    @TableField("card_type_id")
    private Long cardTypeId;

    @TableField("purchase_price")
    private BigDecimal purchasePrice;

    @TableField("start_date")
    private LocalDate startDate;

    @TableField("end_date")
    private LocalDate endDate;

    @TableField("created_at")
    private LocalDateTime createdAt;

    // 关联字段 - 用户昵称
    @TableField(exist = false)
    private String userNickname;

    // 关联字段 - 会员卡类型名称
    @TableField(exist = false)
    private String cardName;

    // 关联字段 - 会员卡价格
    @TableField(exist = false)
    private BigDecimal cardPrice;
    
    // 真实剩余天数 - 不存储在数据库中
    @TableField(exist = false)
    private Integer remainingDays;
}